<template>
    <div>
      <h1>修改用户信息</h1>
      <p>邮箱： <input type="text" v-model="email"></p>
      <p>性别： 男<input type="radio" name="gender" value="男" v-model="sex">&nbsp;女<input type="radio" name="gender" value="女" v-model="sex"> </p>
      <p>年龄： <input type="text" v-model="age"></p>
      <p>住址： <input type="text" v-model="site"></p>
      <p>详细地址： <input type="text" v-model="x_site"></p>
      <p><button @click="commint">提交</button></p>
    </div>
</template>

<script>
  import axios from 'axios'
    export default {
        name: "adduserinfo",
        data(){
            return{
                email:'',
                sex:'',
                age:'' ,
                site:'',
                x_site:'',
                token:sessionStorage.getItem('token')
            }
        },
        methods:{
            commint(){
                let fdata=new FormData()
                fdata.append('email',this.email)
                fdata.append('sex',this.sex)
                fdata.append('age',this.age)
                fdata.append('site',this.site)
                fdata.append('x_site',this.x_site)
                fdata.append('token',this.token)
                this.axios({
                    url:'/app01/update_info/',
                    method:'post',
                    data:fdata
                }).then(resp=>{
                    console.log(resp.data)
                    if (resp.data.code==200){
                        this.$router.push('/index')
                    }
                })
            }
        },
        created() {
        }
    }
</script>

<style scoped>

</style>